// ui/admin-ui/src/api/role.js
import service from '@/utils/request.js'
export default {
    list(query){ return service.get('/role/list', { params: query }) },
    selectAll(){ return service.get('/role/selectAll')},
    deleteById(id){ return service.delete(`/role/deleteById/${id}`) },
    deleteAll(ids){ return service.delete(`/role/deleteAll/${ids}`) },
    add(data){ return service.post('/role/add', data) },
    selectById(id){ return service.get(`/role/selectById/${id}`) },
    update(data){ return service.put('/role/update', data) },
    selectAssignedPermission(roleId) {
        return service.get(`/role/selectAssignedPermission/${roleId}`)
    },
    assignPermission(roleId, permissionIds) {
        return service.post('/role/assignPermission',null,{params: {roleId,permissionIds}})
    }
}